/*******************************************************
 *
 *            random function
 *            Module:random.c
 *       Copyright(c)2015-2016 njxzc.
 *            All Rights Reserved.
 *
 *History:
 *    Author  :  royxu
 *    Time    :  2015-9-21
 *    Version :  1.0
 *    Desc    :  Build this file
 *
********************************************************/

#include <reg52.h>
#include <stdio.h>
#include <stdlib.h>
#include "MacroAndConst.h"

/******************************************************
 *
 *Function Prototype:
 *    void main();
 *
 *Function Description:
 *param[in]num: xnum's first address;seed:random initialization; M:length of arrayxnum
 *param[out] xnum
 *
 *return     none
 *
*******************************************************/

	



void GetRandom(int num[],int seed,int M)
{
	int i;
	srand(seed);// set the seed
	for (i=0;i<M;i++) //
	{
		num[i]=rand()%133;
	//	printf("num[%d]=%d,",i,num[i]);
	}
}



